SELECT "TO_CHAR"(FORMMAIN_2083.FIELD0004,'yyyy-mm-dd hh:mm:ss') as  time,
ORG_UNIT.CODE dept,
FORMMAIN_2571.FIELD0013 supplier,
ORG_MEMBER.CODE psndoc,
FORMMAIN_2083.FIELD0005 contractno,
FORMMAIN_2083.FIELD0009 paymny,
CASE WHEN YFK.SHOWVALUE = '是' THEN 'Y' ELSE 'N' END isPrepay ,
CASE WHEN bzj.SHOWVALUE = '是' THEN 'Y' ELSE 'N' END isQualititymy,
CASE WHEN wyj.SHOWVALUE = '是' THEN 'Y' ELSE 'N' END isRefuse,
jsfs.ENUMVALUE balaType,FORMMAIN_3043.FIELD0004 planitem
FROM COL_SUMMARY
LEFT JOIN FORMMAIN_2083 ON FORMMAIN_2083."ID" = COL_SUMMARY.FORM_RECORDID
LEFT JOIN CTP_ENUM_ITEM yfk ON YFK."ID" = FORMMAIN_2083.FIELD0032
LEFT JOIN CTP_ENUM_ITEM bzj ON bzj."ID" = FORMMAIN_2083.FIELD0033
LEFT JOIN CTP_ENUM_ITEM wyj ON wyj."ID" = FORMMAIN_2083.FIELD0034
LEFT JOIN CTP_ENUM_ITEM jsfs ON jsfs."ID" = FORMMAIN_2083.FIELD0035
LEFT JOIN FORMSON_2581 ON FORMSON_2581.FORMMAIN_ID = FORMMAIN_2083."ID"
LEFT JOIN ORG_MEMBER ON ORG_MEMBER."ID" = FORMMAIN_2083.FIELD0002
LEFT JOIN ORG_UNIT ON ORG_UNIT."ID" = FORMMAIN_2083.FIELD0003
LEFT JOIN FORMMAIN_2571 ON FORMMAIN_2571.FIELD0002 = FORMSON_2581.FIELD0026 
LEFT JOIN FORMMAIN_3043 ON FORMMAIN_3043.FIELD0001 = FORMMAIN_2083.FIELD0031
WHERE COL_SUMMARY."ID" = '${id}'